{{- $binaries := "/cephcsi /sbin/mount.ceph /usr/bin/ceph-fuse /bin/mount /bin/umount /sbin/fsck /sbin/modprobe /bin/kmod /usr/bin/rbd /usr/bin/rbd-nbd /sbin/blkid /sbin/mkfs /sbin/mkfs.ext4 /sbin/mkfs.xfs /sbin/blockdev /sbin/dumpe2fs /usr/sbin/xfs_io /usr/sbin/xfs_growfs /sbin/resize2fs" }}
---
artifact: {{ $.ModuleName }}/{{ $.ImageName }}-binaries-artifact
from: {{ .Images.BASE_ALT_DEV }}
shell:
  install:
    - mkdir -p /src
    - cd /src
    - git clone --branch v3.7.2 --depth 1 {{ $.SOURCE_REPO }}/ceph/ceph-csi.git .
    - export GOPROXY={{ $.GOPROXY }}
    - export CGO_ENABLED=1
    - make cephcsi
    - cp _output/cephcsi /cephcsi
    - /binary_replace.sh -i "{{ $binaries }}" -o /relocate
---
image: {{ .ModuleName }}/{{ .ImageName }}
fromImage: common/distroless
import:
  - artifact: {{ $.ModuleName }}/{{ $.ImageName }}-binaries-artifact
    add: /relocate
    to: /
    before: setup
docker:
  ENTRYPOINT: ["/cephcsi"]
